package com.adcc.loadsheet.monitor.vo;

import com.adcc.loadsheet.monitor.entity.MQMonitor;
import com.adcc.loadsheet.monitor.entity.MonitorStatus;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.base.Strings;

public class MQMonitorVO extends BaseVO<MQMonitor> {

    // IP地址
    private String ip;

    // 上行TOPIC名称
    private String uplinkTopic;

    // 上行TOPIC消费者数量
    private long uplinkTopicConsumerNum;

    // 上行TOPIC入消息总数
    private long unlinkTopicEnqueued;

    // 下行TOPIC名称
    private String downlinkTopic;

    // 下行TOPIC消费者数量
    private long downlinkTopicConsumerNum;

    // 下行TOPIC入消息总数
    private long downlinkTopicEnqueued;

    // 总体状态
    private MonitorStatus status;

    public MQMonitorVO() {

    }

    public MQMonitorVO(MQMonitor mqMonitor) {
        ip = Strings.nullToEmpty(mqMonitor.getIp());
        uplinkTopic = Strings.nullToEmpty(mqMonitor.getUplinkTopic());
        uplinkTopicConsumerNum = mqMonitor.getUplinkTopicConsumerNum();
        unlinkTopicEnqueued = mqMonitor.getUnlinkTopicEnqueued();
        downlinkTopic = Strings.nullToEmpty(mqMonitor.getDownlinkTopic());
        downlinkTopicConsumerNum = mqMonitor.getDownlinkTopicConsumerNum();
        downlinkTopicEnqueued = mqMonitor.getDownlinkTopicEnqueued();
        status = mqMonitor.getStatus();
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getUplinkTopic() {
        return uplinkTopic;
    }

    public void setUplinkTopic(String uplinkTopic) {
        this.uplinkTopic = uplinkTopic;
    }

    public long getUplinkTopicConsumerNum() {
        return uplinkTopicConsumerNum;
    }

    public void setUplinkTopicConsumerNum(long uplinkTopicConsumerNum) {
        this.uplinkTopicConsumerNum = uplinkTopicConsumerNum;
    }

    public long getUnlinkTopicEnqueued() {
        return unlinkTopicEnqueued;
    }

    public void setUnlinkTopicEnqueued(long unlinkTopicEnqueued) {
        this.unlinkTopicEnqueued = unlinkTopicEnqueued;
    }

    public String getDownlinkTopic() {
        return downlinkTopic;
    }

    public void setDownlinkTopic(String downlinkTopic) {
        this.downlinkTopic = downlinkTopic;
    }

    public long getDownlinkTopicConsumerNum() {
        return downlinkTopicConsumerNum;
    }

    public void setDownlinkTopicConsumerNum(long downlinkTopicConsumerNum) {
        this.downlinkTopicConsumerNum = downlinkTopicConsumerNum;
    }

    public long getDownlinkTopicEnqueued() {
        return downlinkTopicEnqueued;
    }

    public void setDownlinkTopicEnqueued(long downlinkTopicEnqueued) {
        this.downlinkTopicEnqueued = downlinkTopicEnqueued;
    }

    public MonitorStatus getStatus() {
        return status;
    }

    public void setStatus(MonitorStatus status) {
        this.status = status;
    }

    @Override
    public MQMonitor toEntity() {
        return null;
    }

    @Override
    public String toJSON() throws JsonProcessingException {
        return null;
    }
}
